package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.FireAlarmMapper;
import com.ruoyi.yanjing.domain.FireAlarm;
import com.ruoyi.yanjing.service.IFireAlarmService;

/**
 * 消防一键报警信息Service业务层处理
 * 
 * @author whz
 * @date 2024-12-04
 */
@Service
public class FireAlarmServiceImpl implements IFireAlarmService 
{
    @Autowired
    private FireAlarmMapper fireAlarmMapper;

    /**
     * 查询消防一键报警信息
     * 
     * @param id 消防一键报警信息主键
     * @return 消防一键报警信息
     */
    @Override
    public FireAlarm selectFireAlarmById(Long id)
    {
        return fireAlarmMapper.selectFireAlarmById(id);
    }

    /**
     * 查询消防一键报警信息列表
     * 
     * @param fireAlarm 消防一键报警信息
     * @return 消防一键报警信息
     */
    @Override
    public List<FireAlarm> selectFireAlarmList(FireAlarm fireAlarm)
    {
        return fireAlarmMapper.selectFireAlarmList(fireAlarm);
    }

    /**
     * 新增消防一键报警信息
     * 
     * @param fireAlarm 消防一键报警信息
     * @return 结果
     */
    @Override
    public int insertFireAlarm(FireAlarm fireAlarm)
    {
        fireAlarm.setCreateTime(DateUtils.getNowDate());
        return fireAlarmMapper.insertFireAlarm(fireAlarm);
    }

    /**
     * 修改消防一键报警信息
     * 
     * @param fireAlarm 消防一键报警信息
     * @return 结果
     */
    @Override
    public int updateFireAlarm(FireAlarm fireAlarm)
    {
        fireAlarm.setUpdateTime(DateUtils.getNowDate());
        return fireAlarmMapper.updateFireAlarm(fireAlarm);
    }

    /**
     * 批量删除消防一键报警信息
     * 
     * @param ids 需要删除的消防一键报警信息主键
     * @return 结果
     */
    @Override
    public int deleteFireAlarmByIds(Long[] ids)
    {
        return fireAlarmMapper.deleteFireAlarmByIds(ids);
    }

    /**
     * 删除消防一键报警信息信息
     * 
     * @param id 消防一键报警信息主键
     * @return 结果
     */
    @Override
    public int deleteFireAlarmById(Long id)
    {
        return fireAlarmMapper.deleteFireAlarmById(id);
    }
}
